package demo01;

import java.util.ArrayList;
import java.util.HashMap;

public class Homework5 {
	public static void main(String[] args) {
		int[] arr1={1,2,3};
		int[] arr2={3,4,5,2};int value=1;
		HashMap<Integer,Integer> map=new HashMap();
		for(int arr:arr1){
			map.put(arr, value);
		}
		for(int arr:arr2){
			if(map.containsKey(arr)){
				value++;
				map.put(arr, value);
			}else{
				map.put(arr, 1);
			}
		}
		ArrayList<Integer> out = new ArrayList<>();
		for (int key : map.keySet()) {
			if(map.get(key)==1){
				out.add(key);
			 }
			}
		System.out.println(out);
	}
}
